Skip to content

Wrap NODE_ENV conditional code in block to remove dead code #911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 28, 2021
Merged

Wrap NODE_ENV conditional code in block to remove dead code #911

merged 3 commits into from
Oct 28, 2021

Conversation

vlazh
Copy link
Contributor

@vlazh vlazh commented Oct 26, 2021

Changes proposed:

  • Wrap NODE_ENV conditional code in block

I use webpack with terser. Some dead code which depends on NODE_ENV not removed because of it not in block scope of if statement. Firefox warn about it. So wrapping that code in block is solved the problem and dead code is removed correctly.

image

image

@vlazh vlazh changed the title Wrap NODE_ENV conditional code in block Wrap NODE_ENV conditional code in block to remove dead code Oct 26, 2021
@diasbruno
Copy link
Collaborator

"Boa!" Thanks, @vlazh.

@diasbruno diasbruno merged commit ffbaf0e into reactjs:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants